package com.bajie.bjlisten.sevice;


import com.bajie.bjlisten.entity.BjDeviceMessage;
import com.bajie.bjlisten.mapper.BjDeviceMessageMapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import javax.transaction.Transactional;

/**
 * 设备消息业务层
 */
@Service
public class BJDeviceMessageService {
    @Autowired
    BjDeviceMessageMapper bjDeviceMessageMapper;

    /**
     * 保存设备消息表
     * @param bjDeviceMessage
     * @return
     */
    @Transactional
    public int save(BjDeviceMessage bjDeviceMessage){
        return bjDeviceMessageMapper.save(bjDeviceMessage);
    }

    /**
     * 根据用户Id查询设备消息表纪录
     * @param userId
     * @return
     */
    public BjDeviceMessage findAllByUserId(String userId){
        return bjDeviceMessageMapper.findAllByUserId(userId);
    }
}
